target = client
srcs = client.cpp 
libs = 
subdirs= 
INCLUDE=-I./ -I/home/brght/usr/zeromq/include 

LIBRARY=-lpthread -lprotobuf -L/home/brght/usr/zeromq/lib -lzmq ../proto.msg.pb.cc

CPPFLAGS+=-g -fpic 
all : $(target)

objs=$(patsubst %.cpp, %.o, $(srcs))

all : $(target)

$(target) : $(objs) 
	for dir in $(subdirs); do make -C $$dir ; done
	g++ $(CPPFLAGS) $(INCLUDE) -o $(target) $^ $(libs) $(LIBRARY) 

%.o : %.cpp
	g++ $(INCLUDE) $(CPPFLAGS) $< -c -o $@

.PHONY : clean sclean
clean:
	for dir in $(subdirs); do make -C $$dir clean; done
	rm -f $(objs)
	rm -f $(target)
sclean:
	rm -f $(objs)
	rm -f $(target)

